package com.jt;

import com.jt.intercector.TimeInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MvcWebConfig implements WebMvcConfigurer {
    //注册拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //                        要拦截的服务                   不拦截的路径
        registry.addInterceptor(new TimeInterceptor()).addPathPatterns("/provider/sentinel01");
    }
}
